<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<base href="../../../" />
		<script src="page.js"></script>
		<link type="text/css" rel="stylesheet" href="page.css" />
	</head>
	<body>
		[page:Object3D] &rarr;

		<h1>[name]</h1>

		<p class="desc">
			The [name] represents a virtual [link:https://developer.mozilla.org/de/docs/Web/API/AudioListener listener] of the all positional and non-positional audio effects in the scene.<br />
			A three.js application usually creates a single instance of [name]. It is a mandatory construtor parameter for audios entities like [page:Audio Audio] and [page:PositionalAudio PositionalAudio].<br />
			In most cases, the listener object is a child of the camera. So the 3D transformation of the camera represents the 3D transformation of the listener.
		</p>

		<h2>Code Example</h2>

		<code>
		// create an AudioListener and add it to the camera
		const listener = new THREE.AudioListener();
		camera.add( listener );

		// create a global audio source
		const sound = new THREE.Audio( listener );

		// load a sound and set it as the Audio object's buffer
		const audioLoader = new THREE.AudioLoader();
		audioLoader.load( 'sounds/ambient.ogg', function( buffer ) {
			sound.setBuffer( buffer );
			sound.setLoop(true);
			sound.setVolume(0.5);
			sound.play();
		});
		</code>

		<h2>Examples</h2>

		<p>
			[example:webaudio_sandbox webaudio / sandbox ]<br />
			[example:webaudio_timing webaudio / timing ]<br />
			[example:webaudio_visualizer webaudio / visualizer ]
		</p>

		<h2>Constructor</h2>


		<h3>[name](  )</h3>
		<p>
		Create a new AudioListener.
		</p>


		<h2>Properties</h2>

		<h3>[property:AudioContext context]</h3>
		<p>The [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext] of the [page:AudioListener listener] given in the constructor.</p>

		<h3>[property:GainNode gain]</h3>
		<p>A [link:https://developer.mozilla.org/en-US/docs/Web/API/GainNode GainNode] created
		using [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createGain AudioContext.createGain]().</p>

		<h3>[property:AudioNode filter]</h3>
		<p>Default is *null*.</p>

		<h3>[property:Number timeDelta]</h3>
		<p>Time delta value for audio entities. Use in context of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/linearRampToValueAtTime AudioParam.linearRampToValueAtTimeDefault](). Default is *0*.</p>

		<h2>Methods</h2>


		<h3>[method:GainNode getInput]()</h3>
		<p>
		Return the [page:AudioListener.gain gainNode].
		</p>

		<h3>[method:AudioListener removeFilter]()</h3>
		<p>
		Set the [page:AudioListener.filter filter] property to *null*.
		</p>

		<h3>[method:AudioNode getFilter]()</h3>
		<p>
		Returns the value of the [page:AudioListener.filter filter] property.
		</p>

		<h3>[method:AudioListener setFilter]( [param:AudioNode value] )</h3>
		<p>
		Set the [page:AudioListener.filter filter] property to *value*.
		</p>

		<h3>[method:Float getMasterVolume]()</h3>
		<p>
		Return the volume.
		</p>

		<h3>[method:AudioListener setMasterVolume]( [param:Number value] )</h3>
		<p>
		Set the volume.
		</p>


		<h2>Source</h2>

		<p>
			[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
		</p>
	</body>
</html>
